package cn.lut;

import cn.lut.da02.SomeService;
import cn.lut.da02.Student;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @user:dell
 * @date:2020年10月30 09:21
 */
public class Mytest2 {
    @Test
    public void test1(){
        String config="applicationContext.xml";
        ApplicationContext applicationContext=new ClassPathXmlApplicationContext(config);
        SomeService myService = (SomeService) applicationContext.getBean("myService2");
        String other = myService.doOther("张三", 28);
        System.out.println("原方法的返回值res是"+other);
    }
    @Test
    public void test2(){
        String config="applicationContext.xml";
        ApplicationContext applicationContext=new ClassPathXmlApplicationContext(config);
        SomeService myService = (SomeService) applicationContext.getBean("myService2");
        Student student = myService.doStudent("路明非", 18);
        System.out.println(student);
    }
}
